package com.example.poemtest.index.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;
import java.util.Date;

/**
 * created by JHT on 2024/4/2
 * 小初高传递信息诗词的实体类
 */
public class Poetry implements Serializable {
    private String poetry_desc;
    private String type;
    private String poetry_name;
    private String poetry_author;
    private String poetry_author_dynasty;
    private String poetry_content;
    private Date creatDate;
    private Date reviseDate;
    private boolean isMarry;

//    public static final Creator<Poetry> CREATOR = new Creator<Poetry>() {
//        @Override
//        public Poetry createFromParcel(Parcel in) {
//            return new Poetry(in);
//        }
//
//        @Override
//        public Poetry[] newArray(int size) {
//            return new Poetry[size];
//        }
//    };

    public Poetry() {
    }

    public String getPoetry_desc() {
        return poetry_desc;
    }

    public void setPoetry_desc(String poetry_desc) {
        this.poetry_desc = poetry_desc;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getPoetry_name() {
        return poetry_name;
    }

    public void setPoetry_name(String poetry_name) {
        this.poetry_name = poetry_name;
    }

    public String getPoetry_author() {
        return poetry_author;
    }

    public void setPoetry_author(String poetry_author) {
        this.poetry_author = poetry_author;
    }

    public String getPoetry_author_dynasty() {
        return poetry_author_dynasty;
    }

    public void setPoetry_author_dynasty(String poetry_author_dynasty) {
        this.poetry_author_dynasty = poetry_author_dynasty;
    }

    public String getPoetry_content() {
        return poetry_content;
    }

    public void setPoetry_content(String poetry_content) {
        this.poetry_content = poetry_content;
    }

    public Date getCreatDate() {
        return creatDate;
    }

    public void setCreatDate(Date creatDate) {
        this.creatDate = creatDate;
    }

    public Date getReviseDate() {
        return reviseDate;
    }

    public void setReviseDate(Date reviseDate) {
        this.reviseDate = reviseDate;
    }

    @Override
    public String toString() {
        return "Poetry{" +
                "poetry_desc='" + poetry_desc + '\'' +
                ", type='" + type + '\'' +
                ", poetry_name='" + poetry_name + '\'' +
                ", poetry_author='" + poetry_author + '\'' +
                ", poetry_author_dynasty='" + poetry_author_dynasty + '\'' +
                ", poetry_content='" + poetry_content + '\'' +
                ", creatDate=" + creatDate +
                '}';
    }

    public Poetry(Parcel in) {
        poetry_name = in.readString();
        poetry_author = in.readString();
        poetry_author_dynasty = in.readString();
        poetry_content = in.readString();
        //将byte再转化回布尔值
        isMarry = in.readByte() != 0;
    }

//    @Override
//    public int describeContents() {
//        return 0;
//    }
//
//    @Override
//    public void writeToParcel(Parcel dest, int flags) {
//        dest.writeString(poetry_name);
//        dest.writeString(poetry_author);
//        dest.writeString(poetry_author_dynasty);
//        dest.writeString(poetry_content);
//        //布尔值这里是将之转化成byte进行序列化
//        dest.writeByte((byte) (isMarry ? 1 : 0));
//    }
}
